const {
	Controller
} = require('uni-cloud-router');
const {
	success,
	exception,
	error,
	typeOf,
} = require("lg-utils");
module.exports = class CommonController extends Controller {

	/***
		 @type GET 
		 @description : xxx
		 @param {type}
	***/
	async xxx() {
		try {
			const {
				service,
				data
			} = this.ctx;
			return await service.xxx.xxx();

		} catch (e) {
			return exception(e, this);
		}

	}
	/***
		 @type GET 
		 @description : 获取A股是否收市;
		 @param {type}
	***/
	async getMarketIsCloseWithA() {
		try {
			const {
				service,
				data
			} = this.ctx;
			return await service.common.getMarketIsCloseWithA();

		} catch (e) {
			return exception(this,"获取A股是否收市异常;",e);
		}

	}

	/***
		 @type GET 
		 @description : 获取所有市场运营信息
		 @param {
		symbol = "sz000100", 股票标识
		cycle = 0,           周期 0：当天
		type = StatusEnum.DAY k线类型 day week month
	}
	***/
	async getMarketsInfoList() {
		try {
			const {
				service,
				data
			} = this.ctx;

			return await service.common.getMarketsInfoList(data);
		} catch (e) {
			return exception(this, "获取所有市场运营信息异常;", e);
		}

	}

}
